package com.nulstudio.sppm.network;
import java.util.Objects;
public class CreateCommodityRequest {
    private final String name, notes;
    private final float wholesalePrice, retailPrice, costPrice;

    public CreateCommodityRequest(String name, String notes, float wholesalePrice, float retailPrice, float costPrice) {
        this.name = name;
        this.notes = notes;
        this.wholesalePrice = wholesalePrice;
        this.retailPrice = retailPrice;
        this.costPrice = costPrice;
    }
    public CreateCommodityRequest() {
        this.name = null;
        this.notes = null;
        this.wholesalePrice = 0;
        this.retailPrice = 0;
        this.costPrice = 0;
    }

    public String getName() {
        return name;
    }

    public String getNotes() {
        return notes;
    }

    public float getWholesalePrice() {
        return wholesalePrice;
    }

    public float getRetailPrice() {
        return retailPrice;
    }

    public float getCostPrice() {
        return costPrice;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CreateCommodityRequest that = (CreateCommodityRequest) o;
        return Float.compare(that.wholesalePrice, wholesalePrice) == 0 && Float.compare(that.retailPrice, retailPrice) == 0 && Float.compare(that.costPrice, costPrice) == 0 && Objects.equals(name, that.name) && Objects.equals(notes, that.notes);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, notes, wholesalePrice, retailPrice, costPrice);
    }
}
